<include file="./Tpl/Admin/header.html" />
<div class="main">
	<div class="main_title">
		<img src="/Public/Admin/images/book1.gif"/>&nbsp;&nbsp;充值地址设置
	</div>
	<eq name="module" value="list">
	<div class="list_body">
	    <form action="?s=Admin/ChongZhiUrl/delAll" method="post" id="formid">
		<table cellspacing=0 cellpadding=0 border=0>
		    <tr>
			   <th width="10%">会员ID</th><th width="75%">充值地址</th><th width="10%">操作</th>
			</tr>
			<volist name="list" id="vo">
			<tr>
			   <td>{$vo.userid}</td>
			   <td>
			      <table cellspacing=0 cellpadding=0 border=0>
                  <volist name="vo.types" id="vo1">
				      <tr><td width="20%">{$vo1.typename}</td><td width="70%">{$vo1.url|default='暂无地址'}</td><td width="10%"><gt name="vo1.id" value="0"><a href="?s=Admin/ChongZhiUrl/set/id/{$vo1.id}/userid/{$vo1.userid}/typename/{$vo1.typename}">修改</a></gt><eq name="vo1.id" value="0"><a href="?s=Admin/ChongZhiUrl/addone/userid/{$vo1.userid}/typeid/{$vo1.typeid}">添加</a></eq></td></tr>
				  </volist>
				  </table>
               </td><td><a href="?s=Admin/ChongZhiUrl/del/userid/{$vo.userid}">删除</a></td>
			</tr>
			</volist>
			<tr>
			    <td colspan=4 class="page">
				    <!--input type="button" id="all" value=" 全选 ">
					<input type="button" id="all_return" value=" 全不选 ">
					<input type="button" id="dels" value=" 批量删除 "-->
					<input type="button" id="add" value=" 添加充值地址 ">
					<a href="?s=Admin/ChongZhiUrl/index/page/1">首页</a>
					<a href="?s=Admin/ChongZhiUrl/index/page/{$page-1}">上一页</a>
					<a href="?s=Admin/ChongZhiUrl/index/page/{$page+1}">下一页</a>
					<a href="?s=Admin/ChongZhiUrl/index/page/{$page_num}">尾页</a>
                </td>
			</tr>
		</table>
		</form>
	</div>
	</eq>
	<eq name="module" value="set">
	<div class="main_body">
		<form action="?s=Admin/ChongZhiUrl/update" method="post">
		<input type="hidden" name="module" value="{$module}"/>
		<input type="hidden" name="id" value="{$id}"/>
		<table cellspacing=0 cellpadding=0 border=0>
		<tr><td>会员ID</td><td>{$userid}</td></tr>
		<tr><td>币种名</td><td>{$typename}</td></tr>
		<tr><td>充值地址</td><td><input type="text" name="url" value="{$url}" size="50"/></td></tr>
		</table>
		<div><input type="submit" value="提交"/></div>
		</form>
    </div>
	</eq>
	<eq name="module" value="add">
	<div class="main_body">
		<form action="?s=Admin/ChongZhiUrl/update" method="post">
		<input type="hidden" name="module" value="{$module}"/>
		<table cellspacing=0 cellpadding=0 border=0>
		<tr>
			<td>币种</td>
			<td>
                <select name="typeid">
				    <volist name="types" id="vo">
                    <option value="{$vo.id}">{$vo.name}</option>
					</volist>
				</select>
			</td>
		</tr>
		<tr>
			<td>地址</td>
			<td><textarea name="url" cols=100 rows=20></textarea></td>
		</tr>
		</table>
		<div><input type="submit" value="提交"/></div>
		</form>
    </div>
	</eq>
	<eq name="module" value="addone">
	<div class="main_body">
		<form action="?s=Admin/ChongZhiUrl/update" method="post">
		<input type="hidden" name="module" value="{$module}"/>
		<input type="hidden" name="userid" value="{$userid}"/>
		<input type="hidden" name="typeid" value="{$typeid}"/>
		<table cellspacing=0 cellpadding=0 border=0>
		<tr><td>会员ID</td><td>{$userid}</td></tr>
		<tr><td>币种名</td><td>{$nickname}</td></tr>
		<tr><td>充值地址</td><td><input type="text" name="url" size="50"/></td></tr>
		</table>
		<div><input type="submit" value="提交"/></div>
		</form>
    </div>
	</eq>
</div>
<include file="./Tpl/Admin/footer.html" />
<script language="javascript">
$(document).ready(function(){
    $('#all').click(function(){
	    $('.id').attr('checked',true);
	});
	$('#all_return').click(function(){
	    $('.id').attr('checked',false);
	});
    $('#dels').click(function(){

		f = 0;
	    $('.id').each(function(){
		    if($(this).attr('checked')) f = 1;
		});
		
        if(f==0){
		    alert('请选择要删除的项！');
		}else{
		    $('#formid').submit();
		}
	});
	$('#add').click(function(){
	    location.href="?s=Admin/ChongZhiUrl/add";
	});
});
</script>